#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>

void Bubble_sort(int arr[], int sz)
{
	int i = 0;
	for (i = 0; i < sz - 1; i++)
	{
		int j = 0;
		for (j = 0; j < sz - 1 - i; j++)
		{
			if (arr[j] < arr[j + 1])
			{
				int temp = arr[j];
				arr[j] = arr[j + 1];
				arr[j + 1] = temp;
			}
		}
	}
}

void Print_arr(int arr[], int sz)
{
	int i = 0;
	for (i = 0; i < sz; i++)
	{
		printf("%d", arr[i]);
	}
}
void test()
{
	int x = 0;
	int y = 0;
	scanf("%d %d", &x,&y);
	int i = 0;
	int arr[6] = { 0 };
	while (x != 0)
	{
		arr[i] = x % 10;
		i++;
		x /= 10;
	}

	while (y != 0)
	{
		arr[i] = y % 10;
		i++;
		y /= 10;
	}
	int sz = sizeof(arr) / sizeof(arr[0]);
	Bubble_sort(arr, sz);
	Print_arr(arr, sz);
}


int main()
{
	test();
	return 0;
}